<?php echo $this->fetch('header.html'); ?>
<div id="main" class="w-full">
    <div id="page-cashier" class="w">
        <?php echo $this->fetch('curlocal.html'); ?>
        <div class="online clearfix border mt10 mb20">
            <?php if ($this->_var['payment']['payment_code'] == 'epayalipay' || $this->_var['payment']['payment_code'] == 'epayalipaywap'): ?>
            <?php echo $this->_var['payform']; ?>
            <?php elseif ($this->_var['payment']['payment_code'] == 'epaywxnative'): ?>
            <?php if ($this->_var['payform']['code_url']): ?>
            <div class="epaywxnative">

                <script>
                    setInterval("check_payment()", 2000);
                    function check_payment()
                    {
                        var url = SITE_URL+'/index.php?app=paynotify&act=returnwx&order_sn=<?php echo $this->_var['payform']['order_sn']; ?>';
                        $.get(url, function(result) {
                            if (result == '1') {
                                self.location = SITE_URL+"/index.php?app=account_log&act=logall";
                            } else if (result == '2') {
                                self.location = SITE_URL+"/index.php?app=buyer_order";
                            } else {
                                
                            }
                        });
                    }
                </script>
                <img alt="模式二扫码支付" src="/qrcode.php?data=<?php echo $this->_var['payform']['code_url']; ?>"/>
                <div class="payinfo">微信扫码支付</div>
            </div>
            <?php else: ?>
            <div class="epaywxnative">
                <div class="payinfo">生成支付二维码失败</div>
            </div>
            <?php endif; ?>
            <?php elseif ($this->_var['payment']['payment_code'] == 'epaywxjs'): ?>
            <div class="epaywxjs">
                PC端不支持
            </div>
            <?php endif; ?>
        </div>
    </div>
</div>
<?php echo $this->fetch('server.html'); ?>
<?php echo $this->fetch('footer.html'); ?>
